
use wtask_base::error::WResult;

use crate::{basic::Empty, task::utils::meta::TaskAddMeta, utils::{AppTrait}};


pub(crate) type AppTaskZip = TaskAddMeta;


impl AppTrait for AppTaskZip {
    type Status = ();
    type Res = Empty;

    fn client_handle_before<M: FnMut(bool, String) + Send + Sync>(self, mut msg_func: M, _status: Option<Self::Status>) -> WResult<(Option<Self>, Option<Self::Status>)> {
        if let Err(e) = self.zip_task_files(&mut msg_func) {
            msg_func(true, format!("Task zip error: {}", e));
        }
        Ok((None, None))
    }
}
